/*
* Copyright (c) 2024 -present FengJinjian ( 751965763@qq.com )
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ${package.Entity};

<#list table.importPackages as pkg>
import ${pkg};
</#list>
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

/**
 * ${table.comment!} - ${entity}实体类
 *
 * @version 1.0.1
 * @author ${author}
 * @date ${.now?string('yyyy/MM/dd HH:mm')}
 */
@Data
@TableName(value = "${table.name}", autoResultMap = true)
public class ${entity} {
<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>

    <#if field.keyFlag>
    /**
     * ${field.comment}
     */
    @TableId(type = IdType.AUTO)
    private <#if field.propertyType == "Integer">Long<#else>${field.propertyType}</#if> ${field.propertyName};
    <#else>
    /**
     * ${field.comment}
     */
    <#if field.propertyName == "index">
    @TableField(value = "`index`")
    <#elseif field.propertyName?contains("_")>
    @TableField("${field.name}")
    <#elseif field.propertyName == "createTime">
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    <#elseif field.propertyName == "updateTime">
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    <#elseif field.propertyName == "deleted">
    @TableLogic
    </#if>
    private <#if field.propertyType == "Integer">Long<#else>${field.propertyType}</#if> ${field.propertyName};
    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
}